package Com.aop.pojo;

import Com.aop.dao.DBUtils;
import org.junit.Test;

import java.sql.SQLException;

public class Text {
    @Test
    public  void fun(){
        Top__News_Daoimpl top__news_daoimpl=new Top__News_Daoimpl();
        try {
            top__news_daoimpl.deleteNews(5);
            int i = top__news_daoimpl.deleteNewsid(5);
            DBUtils.commit();
            if (i==1){

                System.out.println("删除成功");
            }else {
                System.out.println("删除失败");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            DBUtils.rollback();
        }

    }
}
